<style type="text/css">
body{background:#eee}
.storelogo img{width:3.2rem;height:3.2rem}
.merchgroup .store-star {padding:0.1rem 0 0.2rem 0;font-size:0.55rem;line-height:1rem}
.merchgroup .store-star img{height:0.66rem}
.star-on,.star-off{position:absolute;top:1rem;left:0;overflow:hidden}
.star-rate {margin-left:3.6rem}
.store-distance{float:right;color:#999}
.store-moneylimit{font-size:0.55rem}
</style>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'main'">
	 <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">约课</div>
		<div class="fui-header-right"></div>
	</div>
	<div class="fui-content" style="padding:0.5rem">
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>课程名</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.serve_title">{{pagedata.lesson.title}}</div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>门店</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.package_title">{{pagedata.store.title}}</div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>时间</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.time">{{pagedata.day}}</div>
        </div>
		<!--<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">上门地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.post.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
        </div>
		-->
		<div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">联系人</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.username" class="weui_input r" type="text" placeholder="请输入联系人">
                </div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd"><label class="weui_label">联系电话</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.mobile" class="weui_input r" type="text" placeholder="请输入电话">
                </div>
        </div>
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>约课费用</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.money">{{pagedata.lesson.price || '0.00'}}元</div>
        </div>
		<div class="weui_cell">
                <div style="visibility:hidden" class="weui_cell_hd"><label class="weui_label">预约费用</label></div>
                <div style="visibility:hidden" class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.money" class="weui_input" type="text" placeholder="" readonly>
                </div>
        </div>
		
		<div class="weui_btn_area">																			
			 <a ng-if="pagedata.lesson.price<0" class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.pay()">确认</a>
			  <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.post,'notice')">确认约课</a>
		</div>
</div>
</div>
<div class="fui-page order-create-page fui-page-current" ng-if="pagedata.op == 'confirmpay'">
	 <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">支付</div>
		<div class="fui-header-right"></div>
	</div>
	<div class="fui-content">
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>课程名</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.serve_title">{{pagedata.lesson.title}}</div>
        </div>

		<!--<div class="weui_cell">
                <div class="weui_cell_hd"><label for="" class="weui_label">上门地址</label></div>
                <div class="weui_cell_bd weui_cell_primary">
                    <input class="weui_input" ng-model="pagedata.post.address" type="text" value="" placeholder="">
                </div>
                <div class="weui_cell_ft">
                    <i class="icon jinyunicon icon-ditu"></i>
                </div>
        </div>
		-->
		<div class="weui_cell">
                <div class="weui_cell_hd weui_cell_primary">
                    <span>约课费用</span>
                </div>
                <div class="weui_cell_ft" ng-model="pagedata.post.money">{{pagedata.lesson.price || '0.00'}}元</div>
        </div>
		<div class="weui_cell">
                <div style="visibility:hidden" class="weui_cell_hd"><label class="weui_label">预约费用</label></div>
                <div style="visibility:hidden" class="weui_cell_bd weui_cell_primary">
                    <input ng-model="pagedata.post.money" class="weui_input" type="text" placeholder="" readonly>
                </div>
        </div>
		
		<div class="weui_btn_area">																			
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.pay()">支付</a>
		</div>
</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script type="text/javascript">
if(scope.pagedata.basic.dingwei!=1){
window.scope.location(function(res){
		scope.$apply(function(){
			scope.pagedata.post.address = res.address;
		});
});
}else{
}

scope.pagedata.pay=function(){
	var params={
		data:{},
		op:'pay',
		callback:function(res){
			if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							scope.message('支付成功！','','jy_bdd/order/list/status=1');
							
						}else{
							scope.message('支付失败！失败原因：'+res.message,'error');
						}
					});
				});
			}
		}
	};
	scope.post_json(params);

}

</script>